<div class="container" ng-controller="publishSubmitController">
    <h4>现在发活</h4>
    <form name="publishForm" class="form-bordered" role="form" ng-submit="submit()" novalidate>
        <div class="form-group" ng-class="{ 'has-warning has-feedback' : publishForm.missionName.$invalid }">
            <label for="inputName">标题</label>
            <input type="text" class="form-control" id="inputName" name="missionName" ng-model="form.missionName" maxlength="30" placeholder="标题，30字以内" required>
            <span ng-show="publishForm.missionName.$invalid" class="glyphicon glyphicon-warning-sign form-control-feedback" aria-hidden="true"></span>
            <div class="warning"
                 ng-show="publishForm.missionName.$invalid">
                <small class="error"
                       ng-show="publishForm.missionName.$error.required">
                    任务标题不能为空
                </small>
            </div>
            <h6 class="text-tips">例1：5分钟宣传片找调色</h6>
            <h6 class="text-tips">例2：院线电影《醉心》找剪辑助理</h6>
        </div>
        <div class="checkbox">
            <label>
                <input type="checkbox" ng-model="isPhonePublic">发布本活儿时公开电话，结束后恢复原状态
            </label>
        </div>
        <div class="checkbox">
            <label>
                <input type="checkbox" ng-model="isAgent">适用于您的公司名称（私活儿可不勾选）
            </label>
        </div>
        <div class="form-group">
            <label for="inputValidTime">任务有效期</label>
            <select class="form-control" id="inputValidTime" ng-init="form.validTime = validTimes[2].value"
                    ng-model="form.validTime" ng-options="m.value as m.name for m in validTimes">
                <!--<option value="">--请选择--</option>-->
            </select>
            <!--<h6 class="text-tips">选择任务有效期后，任务将在有效期截止时下架任务，建议选择长期，可在任务管理随时更改状态</h6>-->
        </div>
        <div class="form-group">
            <label for="inputJobs">岗位筛选</label>
            <input type="hidden" name="jobs" ng-model="form.jobMeaning" required>
            <ul class="ul-tag" id="inputJobs">
                <li ng-repeat="job in jobs" ng-class="{active: job.active == true}" ng-click="jobClick($index)">
                {{ job.stat_name }}
            </li>
            </ul>
            <div class="warning"
                 ng-show="publishForm.jobs.$invalid">
                <small class="error"
                       ng-show="publishForm.jobs.$error.required">
                    至少选择一个岗位
                </small>
            </div>
        </div>
        <div class="form-group">
            <label for="inputDuration">工作时限（可多选）</label>
            <input type="hidden" name="duration" ng-model="form.duration" required>
            <ul class="ul-tag" id="inputDuration">
                <li ng-repeat="duration in durations" ng-class="{active: duration.active == true}" ng-click="durationClick($index)">
                    {{ duration.name }}
                </li>
            </ul>
            <div class="warning"
                 ng-show="publishForm.duration.$invalid">
                <small class="error"
                       ng-show="publishForm.duration.$error.required">
                    至少选择一个时限
                </small>
            </div>
        </div>
        <div class="form-group">
            <label for="inputSalary">薪酬范围</label>
            <select class="form-control" id="inputSalary" ng-init="form.salary1 = salary[1].id"
                    ng-model="form.salary1" ng-options="m.id as m.name for m in salary">
                <!--<option value="">--请选择--</option>-->
            </select>
            <input type="number" class="form-control" ng-show="form.salary1 == 1"
                   ng-model="form.salary2" placeholder="输入薪酬数额">
            <h6 class="text-tips">自填格式：如包活3w起；xx/天等；涨经验即无报酬</h6>
        </div>
        <div class="form-group">
            <label for="inputLocation">工作地点</label>
            <div class="row" id="inputLocation">
                <div class="col-xs-4">
                    <select class="form-control"  ng-init="form.location1 = locations[0].id"
                            ng-init="form.location2 = ''" ng-model="form.location1" ng-options="m.id as m.name for m in locations">
                        <!--<option value="">--请选择--</option>-->
                    </select>
                </div>
                <div ng-show="form.location1 == 3">
                    <div class="col-xs-4">
                        <select id="selectP" class="form-control" ng-model="province" ng-options="m for m in provinces" ng-change="cascade()">
                            <option value="">--省份--</option>
                        </select>
                    </div>
                    <div class="col-xs-4">
                        <select class="form-control" ng-model="city" ng-options="m for m in cities">
                            <option value="">--城市--</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="inputDesc">详细描述</label>
            <textarea rows="4" class="form-control" id="inputDesc" ng-model="form.description" placeholder="任务详细描述"></textarea>
            <!--<h6 class="text-tips">600字以内</h6>-->
        </div>
        <div class="center">
            <button type="submit" class="btn btn-default btn-main" ng-disabled="publishForm.$invalid">发布</button>
        </div>
    </form>
</div>